#!/usr/bin/env python
#-*-conding:utf-8-*-

import requests # 发送http请求

path = 'C:/Users/Administrator/Desktop/tmp'

headers = {
	'user-agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.26 Safari/537.36 Core/1.63.6788.400 QQBrowser/10.3.2864.400',
	'Referer':''
}

# 下载video
def download_video(video_url, path, headers):
	video = requests.get(video_url,  headers=headers, timeout=60)
	name = path+'/'+video_url.split('/')[-1]
	with open(name, 'ab') as f:
		f.write(video.content)

download_video('http://127.0.0.1/test/1.mp4', path, headers)